home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / uwpc201.zip / UW-SRC.ZIP / UWPROTO.H < prev    next >
C/C++ Source or Header  |  1991-11-04  |  5KB  |  128 lines

  1. /*-------------------------------------------------------------------------
  2.  
  3.   UWPROTO.H - Special declarations for the Unix Windows protocol.
  4.  
  5.     This file is part of UW/PC - a multi-window comms package for the PC.
  6.     Copyright (C) 1990-1991  Rhys Weatherley
  7.  
  8.     This program is free software; you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation; either version 1, or (at your option)
  11.     any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program; if not, write to the Free Software
  20.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22.   Revision History:
  23.   ================
  24.  
  25.    Version  DD/MM/YY  By  Description
  26.    -------  --------  --  --------------------------------------
  27.      1.0    15/12/90  RW  Original Version of UWPROTO.H
  28.      1.1    03/03/91  RW  Add protocol negotiation definitions.
  29.  
  30.   You may contact the author by:
  31.   =============================
  32.  
  33.    e-mail: rhys@cs.uq.oz.au
  34.      mail: Rhys Weatherley
  35.        5 Horizon Drive
  36.        Jamboree Heights
  37.        Queensland 4074
  38.        Australia
  39.  
  40. -------------------------------------------------------------------------*/
  41.  
  42. #ifndef __UWPROTO_H__
  43. #define    __UWPROTO_H__
  44.  
  45. /* Protocol 1 definitions and macros */
  46.  
  47. #define    P1_IAC        0001    /* interpret following byte as a command */
  48. #define P1_DIR        0100    /* command direction: */
  49. #define P1_DIR_HTOC    0000    /*    host to client */
  50. #define    P1_DIR_CTOH    0100    /*    client to host */
  51.  
  52. #define    P1_FN        0070    /* function code: */
  53. #define    P1_FN_ARG    0007    /*    extract function argument */
  54. #define P1_FN_NEWW    0000    /*    create new window */
  55. #define    P1_FN_KILLW    0010    /*    kill (destroy) window */
  56. #define    P1_FN_ISELW    0020    /*    select window for input data */
  57. #define    P1_FN_OSELW    0030    /*    select window for output data */
  58. #define P1_FN_META    0050    /*    add META to next data character */
  59. #define P1_FN_CTLCH    0060    /*    send control character as data */
  60. #define    P1_FN_MAINT    0070    /*    perform "maintenance function" */
  61.  
  62. #define    P1_CC        0007    /* control character specifier: */
  63. #define P1_CC_IAC    0001    /*    P1_IAC (001) */
  64. #define    P1_CC_XON    0002    /*    P1_XON (021) */
  65. #define    P1_CC_XOFF    0003    /*    P1_XOFF (023) */
  66.  
  67. #define P1_MF        0007    /* maintenance functions: */
  68. #define    P1_MF_ENTRY    0000    /*    start up */
  69. #define P1_MF_ASKPCL    0002    /*    request protocol negotiation */
  70. #define P1_MF_CANPCL    0003    /*    suggest protocol */
  71. #define P1_MF_SETPCL    0004    /*    set new protocol */
  72. #define    P1_MF_EXIT    0007    /*    exit */
  73.  
  74. /* Protocol 2 specific definitions and macros */
  75.  
  76. #define    P2_FN_WOPT    0040    /*    communicate window options */
  77.  
  78. /* Window option declarations */
  79.  
  80. #define    WOG_END        0    /* end of options */
  81. #define    WOG_VIS        1    /* visibility */
  82. #define    WOG_TYPE    2    /* window emulation type */
  83. #define    WOG_POS        3    /* window position on screen */
  84. #define    WOG_TITLE    4    /* window title */
  85. #define    WOG_SIZE    5    /* window size (in pixels) */
  86. #define    WOG_6        6    /* reserved */
  87. #define    WOG_7        7    /* reserved */
  88.  
  89. #define    WOTTY_SIZE    8    /* (row,col) terminal size */
  90. #define    WOTTY_FONTSZ    9    /* font size index */
  91. #define    WOTTY_MOUSE    10    /* mouse interpretation */
  92. #define    WOTTY_BELL    11    /* audible, visible bell */
  93. #define    WOTTY_CURSOR    12    /* cursor shape */
  94.  
  95. /* Window option management commands */
  96.  
  97. #define    WOC_SET        0    /* change value of option */
  98. #define    WOC_INQUIRE    2    /* ask about current option value */
  99. #define    WOC_DO        4    /* do report changes to option */
  100. #define    WOC_DONT    5    /* don't report changes to option */
  101. #define    WOC_WILL    6    /* will report changes to option */
  102. #define    WOC_WONT    7    /* won't report changes to option */
  103.  
  104. /* Window option encoding and decoding declarations */
  105.  
  106. #define    WONUM_MIN     1        /* minimum option number */
  107. #define    WONUM_GENERIC     7        /* maximum generic option number */
  108. #define    WONUM_SHORT     14        /* maximum short option number */
  109. #define    WONUM_MAX     31        /* maximum option number */
  110. #define    WONUM_MASK     (017<<3)    /* mask for option extraction */
  111. #define    WONUM_SENCODE(n) (((n)&017)<<3)    /* short encoding function */
  112. #define    WONUM_SDECODE(c) (((c)>>3)&017)    /* short decoding function */
  113. #define    WONUM_LPREFIX     (017<<3)    /* long encoding prefix */
  114. #define    WONUM_LENCODE(n) ((n)+' ')    /* long encoding function */
  115. #define    WONUM_LDECODE(c) (((c)&0177)-' ') /* long decoding function */
  116.  
  117. /* Define the standard UW terminal types */
  118.  
  119. #define    UWT_ADM31    0    /* ADM-31 cursor-addressible terminal */
  120. #define    UWT_VT52    1    /* VT52 cursor-addressible terminal */
  121. #define    UWT_ANSI    2    /* ANSI-compatible terminal */
  122. #define    UWT_TEK4010    3    /* Tektronix 4010 graphics terminal */
  123. #define    UWT_FTP        4    /* File transfer window */
  124. #define    UWT_PRINT    5    /* Output to printer */
  125. #define    UWT_PLOT    6    /* Plot window */
  126.  
  127. #endif    /* __UWPROTO_H__ */
  128.